void victim_function(int x)
{
...
if (x < array1_size)
y = array2[array1[x]];
...
}
x is malicious, array1[x] is the
secret value!if (array1_size < 1) vs. if ((float) x / (float) array1_size < 1)Our implementation is also full of tips in the comments, feel free to look at it!
size = '32kB'
assoc = 2
data_latency = 1
mshrs = 4
tgts_per_mshr = 8
write_buffers = 4
prefetcher = StridePrefetcher(queue_size=4, degree=4)
for cpu in self.cpus:
cpu.createThreads()
cpu.createInterruptController()
cpu.branchPredAdd()
if system.getMemoryMode() == "timing":
self.cacheAddL1()
self.cacheAddL2()
cpu.dtb.walker.port = bus.slave
cpu.itb.walker.port = bus.slave
cpu.dcache_port = bus.slave
cpu.icache_port = bus.slave
kernel_cmd = [
"console=ttyAMA0",
"root=/dev/vda1",
"rw",
"mem=2G@0x80000000",
]
./build/ARM/gem5.opt ./configs/example/arm/starter_fs.py --num-cores=4 --disk-image="aarch64-ubuntu.img" --kernel="vmlinux.arm64"
gem5/util/term/m5term localhost 3456
==== m5 slave terminal: Terminal 0 ====
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd070]
[ 0.000000] Linux version 4.18.0+ (arm-employee@arm-computer) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1))
[ 0.000000] Machine model: V2P-CA15
[ 0.000000] Memory limited to 2048MB
...
...
[ 0.256634] random: init: uninitialized urandom read (12 bytes read)
[ 0.271877] init: hwclock main process (684) terminated with status 1
[ 0.286689] random: mountall: uninitialized urandom read (12 bytes read)
Ubuntu 14.04 LTS aarch64-gem5 ttyAMA0
aarch64-gem5 login: root
Welcome to Ubuntu 14.04 LTS (GNU/Linux 4.18.0+ aarch64)
root@aarch64-gem5:~#
perf_event \(\Rightarrow\) measurements workingpierre.ayoub@eurecom.fr
| Accuracy Ratio | Accuracy Ratio | |
|---|---|---|
| Metric | Mean | Standard Deviation |
| Retrieved Bytes | 1.05 | NaN |
| Iterations | 0.57 | 3.81 |
| Cycles | 0.31 | 2.12 |
| Cache Misses | 584.08 | 4581.02 |
| Mispredicted Branches | 0.99 | 2.41 |